<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
include_once '../Login/databaseconnection.php';

if(!loggedin())
{
	require_once '../index.php';
}
   
   else
   {	
 $Pro_Id=$_POST['Pro_Id'];
    $Year=$_POST['Year'];
 $Sch_Id=$_POST['Sch_Id'];
   $Pro_name=$_POST['Pro_name'];
   $No_Stu=$_POST['No_Stu'];
$No_Tra_tea=$_POST['No_Tera_tea'];
   $Tra_tea=$_POST['Tra_tea'];
    $Avai_Book=$_POST['Avai_Book'];
   $Avai_Tea_Gui=$_POST['Avai_Tea_Gui'];
  if($Pro_Id!=null&&$Year!=null&&$Sch_Id!=null&&$No_Stu!=null&&$No_Tra_tea!=null&&$Tra_tea!=null&&$Pro_name!=null)
	{
$sql=mysql_query("INSERT INTO programmes(Programme_Id,Year,School_Id,Programme_Name,No_Of_Students,Teachers_In_Training,Trained_Teachers,Availability_Books,Availability_Tguides)values('$Pro_Id','$Year','$Sch_Id','$Pro_name','$No_Stu','$No_Tra_tea','$Tra_tea','$Avai_Book','$Avai_Tea_Gui')");
if($sql)
  {
$_SESSION['error']="This record is successfully registered!";
  }

  if(!$sql)
  {
$_SESSION['error']="Sorry unable to register this record!";
  }
  }
 if($Pro_Id==""||$Year==""||$Sch_Id==""||$Pro_name==""||$No_Stu==""||$No_Tra_tea==""||$Tra_tea=="")
	{
	$_SESSION['errorin']="Please fill all!";
  }
   }
?>
</body>
</html>
